
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
     <include file="Index/head" />
    <link href="__PUBLIC__/css/dashboard.css" rel="stylesheet">

  </head>

  <body>

    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
<!--           <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button> -->
          <a class="navbar-brand" href="#">数据字典</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
<!--             <li><a href="#">Dashboard</a></li>
            <li><a href="#">Settings</a></li>
            <li><a href="#">Profile</a></li>
            <li><a href="#">Help</a></li> -->
          </ul>
          <form class="navbar-form navbar-right">
            <input type="text" class="form-control" placeholder="Search...">
          </form>
        </div>
      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
          <include file="Index/menu" />
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <h2 class="sub-header">修改字段</h2>
          <div class="table-responsive">
              <form action="{:U('Home/Fields/modify')}" method="post">
                <div class="form-group">
                  <label for="exampleInputEmail1">FieldName</label>
                  <input type="text" required="required" name="fl_name" class="form-control" value="{$list.fl_name}">
                </div>
                <div class="form-group">
                  <label for="exampleInputEmail1">FieldName(中文)</label>
                  <input type="text" required="required" name="fl_name_ch" class="form-control" value="{$list.fl_name_ch}">
                </div>
                <div class="form-group">
                  <label for="exampleInputEmail1">字段类型</label>
                  <select class="form-control select_type" name="type_name">
                    <option value="0">字符类型</option>
                    <option style="color:red;" value="0">整数类型</option>
                    <option value="TINYINT">TINYINT        1字节        (-128，127)          (0，255)            小整数值 </option>
                    <option value="SMALLINT">SMALLINT       2字节     (-32 768，32 767)       (0，65 535)         大整数值 </option>
                    <option value="MEDIUMINT">MEDIUMINT      3字节    (-8 388 608，8 388 607) (0，16 777 215)      大整数值 </option>
                    <option value="INT">INT            4字节   (-2 147 483 648，2 147 483 647) (0，4 294 967 295) 大整数值 </option>
                    <option value="BIGINT">BIGINT         8字节   (-9 233 372 036 854 775 808，9 223 372 036 854 775 807) (0，18 446 744 073 709 551 615) 极大整数值 </option>
                    <option value="FLOAT">FLOAT          4字节   (-3.402 823 466 E+38，1.175 494 351 E-38)，0，(1.175 494 351 E-38，3.402 823 466 351 E+38) 0，(1.175 494 351 E-38，3.402 823 466 E+38) 单精度浮点数值 </option>
                    <option value="DOUBLE">DOUBLE         8字节 (1.797 693 134 862 315 7 E+308，2.225 073 858 507 201 4 E-308)，0，(2.225 073 858 507 201 4 E-308，1.797 693 134 862 315 7 E+308) 0，(2.225 073 858 507 201 4 E-308，1.797 693 134 862 315 7 E+308) 双精度浮点数值 </option>
                    <option value="DECIMAL">DECIMAL 对DECIMAL(M,D) ，如果M>D，为M+2否则为D+2 依赖于M和D的值 依赖于M和D的值 小数值</option>
                    <option style="color:red;" value="0">字符串类型</option>
                    <option value="CHAR">CHAR         0-255字节          定长字符串 </option>
                    <option value="VARCHAR">VARCHAR      0-255字节          变长字符串 </option>
                    <option value="TINYBLOB">TINYBLOB     0-255字节        不超过 255 个字符的二进制字符串</option>
                    <option value="TINYTEXT">TINYTEXT     0-255字节        短文本字符串 </option>
                    <option value="BLOB">BLOB         0-65535字节      二进制形式的长文本数据 </option>
                    <option value="TEXT">TEXT         0-65535字节      长文本数据</option>
                    <option value="MEDIUMBLOB">MEDIUMBLOB   0-16 777 215字节 二进制形式的中等长度文本数据</option>
                    <option value="MEDIUMTEXT">MEDIUMTEXT   0-16 777 215字节 中等长度文本数据</option>
                    <option value="LOGNGBLOB">LOGNGBLOB    0-4 294 967 295字节 二进制形式的极大文本数据</option>
                    <option value="LONGTEXT">LONGTEXT     0-4 294 967 295字节 极大文本数据</option>
                    <option value="VARBINARY">VARBINARY(M)                   允许长度0-M个字节的定长字节符串，值的长度+1个字节</option>
                    <option value="BINARY">BINARY(M)    M                 允许长度0-M个字节的定长字节符串</option>
                    <option style="color:red;" value="0">日期和时间类型</option>
                    <option value="DATE">DATE       4        1000-01-01/9999-12-31 YYYY-MM-DD    日期值 </option>
                    <option value="TIME">TIME       3        '-838:59:59'/'838:59:59' HH:MM:SS    时间值或持续时间 </option>
                    <option value="YEAR">YEAR       1         1901/2155               YYYY       年份值 </option>
                    <option value="DATETIME">DATETIME   8       1000-01-01 00:00:00/9999-12-31 23:59:59 YYYY-MM-DD HH:MM:SS 混合日期和时间值 </option>
                    <option value="TIMESTAMP">TIMESTAMP  4       1970-01-01 00:00:00/2037 年某时 YYYYMMDD HHMMSS 混合日期和时间值，时间戳</option>
                  </select>
                </div>
                <div class="form-group">
                  <label for="exampleInputEmail1">索引类型</label>
                  <select class="form-control" name="index">
                    <option value="0">选择索引</option>
                    <option value="INDEX">INDEX---普通索引</option>
                    <option value="UNIQUE">UNIQUE---唯一索引</option>
                    <option value="PRIMARY KEY">PRIMARY KEY---主键索引</option>
                    <option value="FULLTEXT">FULLTEXT---全文索引</option>
                  </select>
                </div>
                <div class="form-group">
                  <label for="exampleInputEmail1">isNull</label>
                  <div>
                  <label class="radio-inline">
                    <input type="radio" name="isnull" id="inlineRadio2" value="1"> 是
                  </label>
                  <label class="radio-inline">
                    <input type="radio" name="isnull" id="inlineRadio3" value="0" checked="checked"> 否
                  </label>
                  </div>
                </div>
                <div class="form-group">
                  <label for="exampleInputEmail1">符号</label>
                  <div>
                  <label class="radio-inline">
                    <input type="radio" name="isunsigned" id="inlineRadio2" value="1"> UNSIGNED
                  </label>
                  <label class="radio-inline">
                    <input type="radio" name="isunsigned" id="inlineRadio3" value="0"> SIGNED
                  </label>
                  </div>
                </div>
                <div class="form-group">
                  <label for="exampleInputEmail1">默认值</label>
                  <input type="text" name="default_value" class="form-control" value="{$list.default_value}">
                </div>
<!--                 <div class="form-group">
                  <label for="exampleInputEmail1">&nbsp;</label>
                  <input type="checkbox" value="">自增长
                </div> -->
                <div class="form-group">
                  <label for="exampleInputEmail1">字符长度</label>
                  <input type="text" required="required" name="lengths" class="form-control lenghts" value="{$list.lenghts}" disabled>
                </div>
                <div class="form-group">
                  <label for="exampleInputEmail1">备注</label>
                  <input type="text" required="required" name="comment" class="form-control" value="{$list.comment}">
                </div>
                <div class="form-group">
                  <label for="exampleInputEmail1">排序</label>
                  <input type="text" required="required" name="rank" class="form-control" value="{$list.rank}">
                </div>
                <input type="text" name="flid" value="{$list.flid}" hidden="hidden">
                <div style="margin-top:50px;"></div>
                <button type="submit" class="btn btn-success">修改</button>
                <button type="button" class="btn btn-danger" onclick="history.go(-1)">返回</button>
              </form>
          </div>
        </div>
      </div>
    </div>
      <include file="Index/footer" />
      <script type="text/javascript">
          $(document).ready(function(){

              $(".select_type").bind('change',function(){
                  var select_type_name = $(".select_type  option:selected").val();
                  if(select_type_name == 'CHAR' || select_type_name == 'VARCHAR'){
                      $(".lenghts").attr("disabled",false); 
                  }else{
                      $(".lenghts").attr("disabled",true); 
                  }
              });
              // $(".index_type").on('change',function(){
              //     var index_type_name = $(".index_type  option:selected").val();
              //     if(index_type_name == 'PRIMARY KEY'){
              //         $("#inlineRadio_one").attr("checked",true); 
              //     }else{
              //         $("#inlineRadio_two").attr("checked",true); 
              //     }
              // });
          });
      </script>
  </body>
</html>
